/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pio.action.administrador.solicitudes;

//import DB_OBSOLETA.AspiranteFormDB;
import DBMS.DataBaseManager;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

/**
 *
 * @author charles
 */
public class Listar extends DispatchAction {

    /* forward name="success" path="" */
    private static final String SUCCESS = "success";

    public ActionForward populate(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        return mapping.findForward(SUCCESS);
    }

    public ActionForward pendientes(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        List solicitudes;
        DataBaseManager dbms = DataBaseManager.getInstance();
        solicitudes = dbms.consultarContactos("false");
        request.setAttribute("solicitudes", solicitudes);
        return mapping.findForward(SUCCESS);
    }

    public ActionForward respondidas(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        List solicitudes;
        DataBaseManager dbms = DataBaseManager.getInstance();
        solicitudes = dbms.consultarContactos("true");
        request.setAttribute("solicitudes", solicitudes);
        return mapping.findForward(SUCCESS);
    }
}
